package com.wanxi.service.impl;

import com.wanxi.dao.CuisineDao;
import com.wanxi.dao.impl.CuisineDaoImpl;
import com.wanxi.dto.CuisineDTO;
import com.wanxi.entity.CuisineEntity;
import com.wanxi.service.CuisineService;
import com.wanxi.util.Tool;
import com.wanxi.vo.CuisineVO;

import java.util.List;

public class CuisineServiceImpl implements CuisineService {
    private CuisineDao cuisineDao = new CuisineDaoImpl();


    @Override
    public List<CuisineDTO> findAll(CuisineVO cuisineVO) {
        CuisineEntity cuisineEntity = new CuisineEntity();
        cuisineEntity = Tool.copy(cuisineVO, CuisineEntity.class);
        List<CuisineEntity> list = cuisineDao.findAll(cuisineEntity);
//        怎么集合Entity转换为DTO？
        return Tool.copy(list, CuisineDTO.class);
    }


}
